package com.wcbtest.oshi.domain;

import cn.hutool.core.date.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@ApiModel(value = "服务器相关信息")
@Data
public class OSSys implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "服务器名称")
    private String computerName;

    @ApiModelProperty(value = "服务器Ip")
    private String computerIp;

    @ApiModelProperty(value = "项目路径")
    private String userDir;

    @ApiModelProperty(value = "操作系统")
    private String osName;

    @ApiModelProperty(value = "系统架构")
    private String osArch;

    @ApiModelProperty(value = "获取系统启动时间（自启动以来的时间）。")
    private Long systemUptime;
    private String systemUptimeFormat;
    @ApiModelProperty(value = "系统版本 Microsoft Windows 11 (Home) build 22631")
    private String osVersion;
    @ApiModelProperty(value = "主机名 LAPTOP-GNHB49IK")
    private String hostName;
    @ApiModelProperty(value = "IPV4 172.30.128.1 5")
    private List<String> hostIpv4s;
    @ApiModelProperty(value = "硬件信息\tLENOVO 82RF")
    private String hardwareVersion;

    public String getSystemUptimeFormat() {
        return systemUptime == null ? null : DateUtil.formatBetween(systemUptime);
    }


}